﻿using System.Reflection;

using GCC.Container.Abstracts;

namespace GCC.Container.PluginLoader
{
    /// <summary>
    /// API插件选项
    /// </summary>
    public class PluginInstance
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; init; } = "";
        /// <summary>
        /// 文件sha256
        /// </summary>
        public string Sha256 { get; init; } = "";
        /// <summary>
        /// 版本
        /// </summary>
        public Version Version { get; init; } = new();
        /// <summary>
        /// 插件文件地址
        /// </summary>
        public string PluginFilePath { get; init; } = "";
        /// <summary>
        /// 是否是发布版本
        /// </summary>
        public bool IsRelease { get; init; } = false;

        /// <summary>
        /// 原始程序集
        /// </summary>
        public Assembly? RawAssembly { get; init; }
        /// <summary>
        /// 入口实例
        /// </summary>
        public AbsEntrance? EnteranceInstance { get; init; }

        /// <summary>
        /// 所有的GRPC服务类型
        /// </summary>
        public List<Type> AllGrpcServices { get; init; } = new();
        /// <summary>
        /// 所有的API服务
        /// </summary>
        public List<Type> AllApi { get; init; } = new();
        /// <summary>
        /// 所有的Job服务
        /// </summary>
        public List<Type> AllJobs { get; init; } = new();
    }
}
